/*
 * Copyright 2000-2020 ALPHA LAB.Inc All Rights Reserved.
 */
package com.alphalab.framework.test.queryTest; 

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.alphalab.framework.dao.GeneralQueryDao; 

/**
 * ProjectItemQueryDao.
 * @author allen 
 * @version 1.0.0 2017年12月25日
 */
@Repository
public class ProjectItemQueryDao extends GeneralQueryDao<ProjectItem>  implements IProjectItemQueryDao {

	/**
	 * 获取项目额外信息.
	 * @param projectId projectId
	 * @return List<Map>
	 */ 
	public List<Map> getProjectItemExtendList(final String projectId) {  
		final Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("PROJECTID", projectId); 		 
		return super.findBySql(ProjectItemQueryDaoConst.SQL_GET_PROJECTITEM_EXTENDLIST_BY_PROJECTID, paramMap);
	}
 
	/**
	 * 获取项目信息.
	 * @param projectId projectId
	 * @param description description
	 * @param userName userName
	 * @return List<ProjectItemDetail>
	 */ 
	public List<ProjectItemDetail> getProjectItemDetailList(final String projectId,
			final String description, final String userName) {
		final Map<String, Object> paramMap = new HashMap<String, Object>();
		
		List<String> idStrings = new ArrayList<String>();
		idStrings.add("1");
		idStrings.add("2");
		idStrings.add("3");
		String[] allIds = "4,5".split(",");
		paramMap.put("PROJECTID", idStrings);   
		final List<ProjectItemDetail> projectItemDetails = super.findBySql(
				ProjectItemQueryDaoConst.SQL_GET_PROJECTITEM_LIST_BY_PROJECTID, paramMap, 
				ProjectItemDetail.class); 
		return projectItemDetails;
	} 
	 
}
